home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
String
/
tests
/
tcontains.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
507b
|
21 lines
#include "test.h"
void Contains()
{
String s1("This is a test");
String s2("This"),s3("Thus");
Assert(s1.contains('h')); // char found
Assert(s1.contains("is")); // char * found
Assert(s1.contains(s2)); // String found
Assert(!s1.contains('H')); // char not found
Assert(!s1.contains("junk")); // char * not found
Assert(!s1.contains(s3)); // String not found
s1="abcdsf 123 asfds";
s2="sdfdsfdssdfg";
Assert(s1.contains(SSint)); // Regex found
Assert(!s2.contains(SSint)); // Regex not found
}